Skip to content

Feat: Enable globs & comments in exclude file - #26

Merged
MaximilianSoerenPollak merged 3 commits into
eclipse-score:mainfrom
MaximilianSoerenPollak:MSP_improve_cr_checker
Sep 8, 2026
Merged

Feat: Enable globs & comments in exclude file#26
MaximilianSoerenPollak merged 3 commits into
eclipse-score:mainfrom
MaximilianSoerenPollak:MSP_improve_cr_checker

Conversation

@MaximilianSoerenPollak

Copy link
Copy Markdown
Contributor

Enable usage of globs like ignored-dir/**/* in the excluded_files file.

Also enable comments, making organization of the file easier

PiotrKorkus
PiotrKorkus previously approved these changes Sep 3, 2026

@PiotrKorkus PiotrKorkus left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great improvement in exclusion file readability

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The unresolved performance, compatibility, error-handling, and test-coverage issues must be addressed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds glob patterns and comments to copyright-checker exclusion files.

Changes:

  • Expands workspace-relative exclusion globs.
  • Ignores comments and blank lines.
  • Adds recursive-glob integration coverage.

Review findings:

  • Moderate: Use a set for exclusion lookups to avoid O(inputs × exclusions) scanning.
  • Moderate: Test unmatched globs and the resulting valid=False behavior.
  • Moderate: Preserve support for literal filenames containing glob metacharacters.
  • Moderate: Handle invalid glob patterns without crashing the CLI.
  • Nit: Document glob syntax, comments, and workspace-relative resolution in README.md.
File summaries
File Description
cr_checker/tool/cr_checker.py Implements exclusion parsing and glob expansion.
cr_checker/tests/test_cr_checker.py Tests recursive globs, comments, and literal exclusions.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 5
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cr_checker/tool/cr_checker.py
Comment on lines +207 to +210
if not matches:
LOGGER.error("Exclusion pattern %s matched nothing.", item)
valid = False
continue

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good finding. WIll include a test for it.

Comment thread cr_checker/tool/cr_checker.py Outdated
Comment on lines +206 to +210
matches = {str(match) for match in workspace_dir.glob(item)}
if not matches:
LOGGER.error("Exclusion pattern %s matched nothing.", item)
valid = False
continue
Comment thread cr_checker/tool/cr_checker.py Outdated
Comment on lines +180 to +184
Lines may be either a literal path or a glob pattern. A line containing
any of ``*``, ``?`` or ``[`` is expanded with `Path.glob` relative to the
same base directory; ``**`` matches zero or more directory levels, so
``.claude/**/*`` excludes every file and sub-directory below ``.claude``
at any depth. A literal path must point at an existing file, as before.
AlexanderLanin
AlexanderLanin previously approved these changes Sep 8, 2026
@MaximilianSoerenPollak

Copy link
Copy Markdown
Contributor Author

@AlexanderLanin I'm fixing some of the copilot findings right now. Will ping you once I pushed it.

@MaximilianSoerenPollak
MaximilianSoerenPollak merged commit cff3885 into eclipse-score:main Sep 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cr_checker]: Allow for directories & comments in ignore file

4 participants